package homework.day01;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class Note {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("C:/Users/tarena/IdeaProjects/JSD2506_SE/src/main/java/homework/day01/note.txt");
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入要写入的内容：");
        String s=scan.nextLine();

        while( !"exit".equalsIgnoreCase(s)){
            byte[] data =s.getBytes(StandardCharsets.UTF_8);
            fos.write(data);
            System.out.println("写入成功,请继续：");
            s=scan.nextLine();
        }
        System.out.println("写入完成!");
        fos.close();
    }
}
